package com.example.myapplicationtest;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {
   private  Button myBtn_one;
    private  Button myBtn_two;
    AlertDialog dialog1;
    AlertDialog dialog2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
         myBtn_one=(Button) findViewById(R.id.button1);
        myBtn_one=(Button) findViewById(R.id.button2);


        dialog1 =new AlertDialog.Builder(this).setTitle("信息提示框")
               .setMessage("登陆成功")
               .setIcon(R.mipmap.qq)
               .create();


    }
    public void click1(View v){
       EditText editText= (EditText) findViewById(R.id.et_nummber);
        EditText editText1= (EditText) findViewById(R.id.et_nummber1);
       String str1 =editText.getText().toString();
       String str2=editText1.getText().toString();
         if(str1.equals("yufengling")&&str2.equals("123456")){
             dialog1.show();
             Intent intent=new Intent();
             intent.setClass(this, denglu.class);
             startActivity(intent);
         }else{

             AlertDialog  dialog3 =new AlertDialog.Builder(this).setTitle("信息提示框")
                     .setMessage("账户或密码不对")
                     .setIcon(R.mipmap.qq)
                     .create();
             dialog3.show();

         }


    }
    public void click2(View v)
    {    Intent intent=new Intent();
         intent.setClass(this, regist.class);
        startActivity(intent);

    }

}